<?php
class baseControl{
	
	function __construct(){
		$method = $_SERVER['REQUEST_METHOD'];
		if($method!="GET"){
			if($_POST["cmd"]=="put"){
				$method = "PUT";
			}
		}else {
			if($_GET["cmd"]=="delete"){
				$method = "DELETE";
			}
		}
		
		switch($method){
			case "GET":
				$this->get();
				break;
			case "POST":
				$this->post();
				break;
			case "PUT":
				$this->put();
				break;
			case "DELETE":
				$this->delete();
				break;
			default:
				break; //?
		}
	}
	
	function get(){}
	
	function post(){}
	
	function put(){}
	
	function delete(){}
	
	function getCurrentUser(){
		$current_user_id=-1;
		if($_SESSION['current_user_id']!=null){
			$current_user_id = $_SESSION['current_user_id'];
		}else if($_COOKIE['current_user_id']!=null){
			$user_id = 	$_COOKIE['current_user_id'];		
		}
	
	}
	
}
?>